/*
 * BaseBuildingInfoBO.java 
 * 
 * Copyright 2009 Wangfeng Beijing Inc. 
 * All rights reserved. 
 * 
 * Created on 2012-07-06
 */

package com.bjtech.domain.query;

import org.ssi.web.util.QuerySpecTpl;

import com.bjtech.web.util.SelectBean;

/**
 * 功能概述:建筑物信息管理 <br>
 * 
 * @author 王峰
 */

public class BaseBuildingInfoQuerySpec extends SelectBean {
	/* */
	private Long id;
	/* */
	private String b_name;
	/* */
	private Long unit_num;
	/* */
	private Long area_id;
	/* */
	private String attatch_path;
	/* */
	private String sink_name;
	/* */
	private String sink_brand;
	/* */
	private Float sink_height;
	/* */
	private Float sink_width;
	/* */
	private Float sink_length;
	/* */
	private Float sink_cen_dis;
	/* */
	private Float cal_power;
	/* */
	private Long sink_number;
	/* */
	private Long jzq_number;
	/* */
	private String demo;

	@Override
	public void queryParamString() {
		StringBuilder fromPart = new StringBuilder(" where 1=1");

		if (this.isAll != null && this.isAll.intValue() != 1) {
			if (QuerySpecTpl.isValid(id)) {
				fromPart.append(" and a.id = ");
				fromPart.append(id);
			}

			if (QuerySpecTpl.isValid(b_name)) {
				fromPart.append(" and a.b_name like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(b_name);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(unit_num)) {
				fromPart.append(" and a.unit_num = ");
				fromPart.append(unit_num);
			}

			if (QuerySpecTpl.isValid(area_id)) {
				fromPart.append(" and a.area_id = ");
				fromPart.append(area_id);
			}

			if (QuerySpecTpl.isValid(attatch_path)) {
				fromPart.append(" and a.attatch_path like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(attatch_path);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(sink_name)) {
				fromPart.append(" and a.sink_name like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(sink_name);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(sink_brand)) {
				fromPart.append(" and a.sink_brand like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(sink_brand);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(sink_height)) {
				fromPart.append(" and a.sink_height = ");
				fromPart.append(sink_height);
			}

			if (QuerySpecTpl.isValid(sink_width)) {
				fromPart.append(" and a.sink_width = ");
				fromPart.append(sink_width);
			}

			if (QuerySpecTpl.isValid(sink_length)) {
				fromPart.append(" and a.sink_length = ");
				fromPart.append(sink_length);
			}

			if (QuerySpecTpl.isValid(sink_cen_dis)) {
				fromPart.append(" and a.sink_cen_dis = ");
				fromPart.append(sink_cen_dis);
			}

			if (QuerySpecTpl.isValid(cal_power)) {
				fromPart.append(" and a.cal_power = ");
				fromPart.append(cal_power);
			}

			if (QuerySpecTpl.isValid(sink_number)) {
				fromPart.append(" and a.sink_number = ");
				fromPart.append(sink_number);
			}

			if (QuerySpecTpl.isValid(jzq_number)) {
				fromPart.append(" and a.jzq_number = ");
				fromPart.append(jzq_number);
			}

			if (QuerySpecTpl.isValid(demo)) {
				fromPart.append(" and a.demo like ");
				fromPart.append(" CONCAT('%','");
				fromPart.append(demo);
				fromPart.append("','%')");
			}

			if (QuerySpecTpl.isValid(this.direction)
					&& QuerySpecTpl.isValid(this.sort)) {
				fromPart.append(" order by ");
				fromPart.append(this.sort);
				fromPart.append(" ");
				fromPart.append(this.direction);
			} else {
				fromPart.append(" order by ");
				fromPart.append("id");
				fromPart.append(" ");
				fromPart.append("asc");

			}
		}
		super.setQueryString(fromPart.toString());
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getB_name() {
		return this.b_name;
	}

	public void setB_name(String b_name) {
		this.b_name = b_name;
	}

	public Long getUnit_num() {
		return this.unit_num;
	}

	public void setUnit_num(Long unit_num) {
		this.unit_num = unit_num;
	}

	public Long getArea_id() {
		return this.area_id;
	}

	public void setArea_id(Long area_id) {
		this.area_id = area_id;
	}

	public String getAttatch_path() {
		return this.attatch_path;
	}

	public void setAttatch_path(String attatch_path) {
		this.attatch_path = attatch_path;
	}

	public String getSink_name() {
		return this.sink_name;
	}

	public void setSink_name(String sink_name) {
		this.sink_name = sink_name;
	}

	public String getSink_brand() {
		return this.sink_brand;
	}

	public void setSink_brand(String sink_brand) {
		this.sink_brand = sink_brand;
	}

	public Float getSink_height() {
		return this.sink_height;
	}

	public void setSink_height(Float sink_height) {
		this.sink_height = sink_height;
	}

	public Float getSink_width() {
		return this.sink_width;
	}

	public void setSink_width(Float sink_width) {
		this.sink_width = sink_width;
	}

	public Float getSink_length() {
		return this.sink_length;
	}

	public void setSink_length(Float sink_length) {
		this.sink_length = sink_length;
	}

	public Float getSink_cen_dis() {
		return this.sink_cen_dis;
	}

	public void setSink_cen_dis(Float sink_cen_dis) {
		this.sink_cen_dis = sink_cen_dis;
	}

	public Float getCal_power() {
		return this.cal_power;
	}

	public void setCal_power(Float cal_power) {
		this.cal_power = cal_power;
	}

	public Long getSink_number() {
		return this.sink_number;
	}

	public void setSink_number(Long sink_number) {
		this.sink_number = sink_number;
	}

	public Long getJzq_number() {
		return this.jzq_number;
	}

	public void setJzq_number(Long jzq_number) {
		this.jzq_number = jzq_number;
	}

	public String getDemo() {
		return this.demo;
	}

	public void setDemo(String demo) {
		this.demo = demo;
	}
}
